import request from '@/utils/request'
import upload from '@/utils/upload'

// 查询登录用户前4个待考的考试
export function banner() {
	return request({
		url: '/h5/exams/notTestBanner',
		'method': 'get'
	})
}

// 查询登录用户的考试记录
export function history(params) {
	return request({
		url: '/h5/exams/history',
		'method': 'get',
		'data': params
	})
}

// 根据考试id查询所有题目及选项
export function getQuestions(id) {
	return request({
		url: `/h5/exams/questions/${id}`,
		'method': 'get'
	})
}


// 根据考试id查询考生考试状态
export function status(id) {
	return request({
		url: `/h5/exams/status/${id}`,
		'method': 'get'
	})
}




// 更新考试状态
export function updateStatus(id) {
	return request({
		url: `/h5/exams/update/${id}`,
		'method': 'PUT'
	})
}


// 交卷
export function submit(data) {
	return request({
		url: `/h5/exams/submit`,
		'method': 'POST',
		'data': data
	})
}
